package com.ml.mall.utils;

import com.ml.mall.consts.CommonConsts;
import com.ml.mall.entity.sys.SysUser;
import com.ml.mall.security.JwtUtil;

/**
 * @description 对添加用户进行redis存储
 * @author pl
 * @date 2021/6/15
 * @version 1.0
*/
public class UserCompanyRelationUtil {
    //获取当前用户redis的key
    public static String getCurUserCompanyRelationKey(){
        //1.首先需要获取用户基本信息
        SysUser currentUser = JwtUtil.getCurrentUser();
        //2.使用MD5进行盐加密
        String str = MD5.md5(currentUser.getAcc(), currentUser.getSalt());
        return CommonConsts.USER_COMPANY_RELATION_KEY+str;
    }
}
